package com.test.kafka;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * kafka 消费者 demo
 *
 * @author Shaun Wu
 * @date 2021/10/21 19:59
 */
@Component
public class KafkaTestListener {

    @KafkaListener(id = "kafkaTestListener", topics = "myTopic")
    public void listen(ConsumerRecord<String, Object> record) {
        System.out.println("record: " + record.toString());
    }

}
